#ifndef __GZ_INTERFACE_ACTION_SERVER_H__
#define __GZ_INTERFACE_ACTION_SERVER_H__

#include <string>
#include <functional>
#include <memory>

#include "action_context.h"

namespace Gazella {

//context, request, response
typedef std::function<bool(const std::shared_ptr<ActionContext>&, const std::string&, std::string&)> action_goal_callback_t, action_cancel_callback_t;

class GzActionServer {
public:
    GzActionServer();
    ~GzActionServer();

    //create a action server
    static int create_server(
        const std::string& name, //action server interface name
        action_goal_callback_t goal_callback, //goal request callback (it will be called by threadpool)
        action_cancel_callback_t cancel_callback, //cancel request callback (it will be called by threadpool)
        int domain = 0, //doamin id, default 0
        const std::string& describe = "" // action server interface describe
    );

    //delete a action server
    static int delete_server(const std::string& name);
};
} //namespace Gazella
#endif